package com.gla.dao;

import com.gla.domain.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface LoginMapper {
    @Select("SELECT * FROM USER WHERE account=#{account} AND password=#{password}")
    User select(String account,String password);

    @Insert("INSERT INTO USER(name,account,password,is_vip) VALUES(#{name},#{account},#{password},#{is_vip})")
    void register(User user);

    @Select("SELECT * FROM USER WHERE account=#{account}")
    List<User> check(String account);

}
